/*
 * Copyright (c) 2025 EasyAdmin
 * All rights reserved.
 *
 * This file is part of the [EasAdmin] project.
 * Unauthorized copying of this file, via any medium, is strictly prohibited.
 * Proprietary and confidential.
 *
 * Author: EasyAdmin ( 1073602@qq.com )
 * Website: https://www.xhxiao.com
 */
package com.easy.module.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.easy.framework.common.validate.Add;
import com.easy.framework.common.validate.Update;
import com.easy.framework.database.entity.DefaultEntity;
import com.easy.framework.poi.annotation.Excel;
import com.easy.framework.poi.annotation.Option;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

/**
 * 参数配置表 实体
 *
 * @author EasyAdmin ( 1073602@qq.com )
 * @date 2025-08-19
 */
@Getter
@Setter
@TableName("sys_conf")
public class SysConf extends DefaultEntity
{
    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @Excel(name = "编号")
    @NotNull(message = "编号不能为空",groups = {Update.class})
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 名称
     */
    @Excel(name = "名称")
    @NotBlank(message = "名称不能为空",groups = {Add.class, Update.class})
    @Size(message = "名称长度必须小于100个字符",max = 100,groups = {Add.class,Update.class})
    private String name;

    /**
     * 配置KEY
     */
    @Excel(name = "配置KEY")
    @NotBlank(message = "配置KEY长度不能为空",groups = {Add.class,Update.class})
    @Size(message = "配置KEY长度必须小于64个字符",max = 64,groups = {Add.class,Update.class})
    private String confKey;

    /**
     * 配置值
     */
    @Excel(name = "配置值")
    @NotBlank(message = "配置值不能为空")
    @Size(message = "配置值长度必须小于1000个字符",max = 1000,groups = {Add.class,Update.class})
    private String confValue;

    /**
     * 是否系统内置（0否 1是）
     */
    @Excel(name = "是否系统内置", options = {
            @Option(value = "0",name = "否"),
            @Option(value = "1",name = "是")
    })
    @NotNull(message = "是否系统内置不能为空",groups = {Add.class,Update.class})
    private Boolean isSystem;

    /**
     * 范围（0公开配置，1登录配置，2后台服务配置）
     */
    @Excel(name = "范围", options = {
            @Option(value = "0",name = "公开配置"),
            @Option(value = "1",name = "登录配置"),
            @Option(value = "2",name = "后台服务配置")
    })
    @NotNull(message = "范围不能为空",groups = {Add.class,Update.class})
    private Integer scope;

    /**
     * 备注
     */
    @Excel(name = "备注")
    @Size(message = "备注长度必须小于500个字符",max = 500,groups = {Add.class,Update.class})
    private String remark;
}
